<?php

/**
 * AbetDepartment form base class.
 *
 * @method AbetDepartment getObject() Returns the current form's model object
 *
 * @package    sfproject
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseAbetDepartmentForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'dep_code'   => new sfWidgetFormInputHidden(),
      'dep_name'   => new sfWidgetFormInputText(),
      'dep_phone'  => new sfWidgetFormInputText(),
      'ins_code'   => new sfWidgetFormInputHidden(),
      'col_code'   => new sfWidgetFormInputHidden(),
      'created_at' => new sfWidgetFormDateTime(),
      'updated_at' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'dep_code'   => new sfValidatorChoice(array('choices' => array($this->getObject()->getDepCode()), 'empty_value' => $this->getObject()->getDepCode(), 'required' => false)),
      'dep_name'   => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'dep_phone'  => new sfValidatorString(array('max_length' => 9, 'required' => false)),
      'ins_code'   => new sfValidatorPropelChoice(array('model' => 'AbetInstructor', 'column' => 'ins_code', 'required' => false)),
      'col_code'   => new sfValidatorPropelChoice(array('model' => 'AbetCollege', 'column' => 'col_code', 'required' => false)),
      'created_at' => new sfValidatorDateTime(array('required' => false)),
      'updated_at' => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('abet_department[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetDepartment';
  }


}
